<?php

namespace ProductAjax;

use ProductAjax\Model\ProductModel;

class Module {

    public function getConfig() {
        return include __DIR__ . '/config/module.config.php';
    }

    public function getAutoloaderConfig() {
        return array(
            'Zend\Loader\StandardAutoloader' => array(
                'namespaces' => array(
                    __NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__,
                ),
            ),
        );
    }

    public function getServiceConfig() {

        return array(
            'factories' => array(
                
                'ProductAjaxModel' => function($sm) {

                    $adapter = $sm->get('Zend\Db\Adapter\Adapter');

                    $productModel = new ProductModel($adapter);

                    return $productModel;
                }
            )
        );
    }

}
